<%@ page language="java" pageEncoding="UTF-8"%>
<%@include file="/pc/jsp/common/common.jsp"%>
<%@ page language="java" import="com.limao.DBDataClass.CrowdVRHomeClass"%>
<%@ page language="java" import="com.limao.DBDataClass.CrowdUserAuthClass"%>

<%
 String userid=(String)CacheClass.isLogin(request,response);
 if(CacheClass.getIntValue(userid)==0)
 {
 	out.println("<script language='JavaScript'>alert('您还没有登陆！');location.href='';</script>"); //后退并刷新
 	return;
 } 
 CrowdUserAuthClass user= WebFunction.getUserInfo(request,response);
 if(user==null)
 {
	 out.println("<script language='JavaScript'>alert('用户不存在，或被平台禁用，请联系客服！');window.history.back(-1);</script>");
	 return;
 } 
 
 CrowdVRHomeClass obj= WebFunction.getVrHomeInfo(request,response);
 if(obj==null)
 {
	 out.println("<script language='JavaScript'>alert('交易公司不存在，或平台已中止与供公司合作，暂不开放提单交易服务！');window.history.back(-1);</script>");
	 return;
 }
 %>
  
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<head>
    <title>提单交易 </title>
    <script>
		$(window).load(function() {
			headertabcurrent=4;
			$("#header").load("pc/header.jsp"); 
			$("#footer").load("pc/footer.jsp"); 
		});
	</script>
    <script>
        if ($.browser.msie && $.browser.version <= 10.0)
        {
            layer.alert( "很抱歉，您的浏览器版本过低，网站功能支持较低，请您用IE11.0以上的浏览器或者其他浏览器浏览网页，推荐使用360（极速）浏览器;推荐使用谷歌浏览器");
            window.location.href=baseUrl+"pc/browserRecommend.jsp";
            $(".theme-popover-mask").fadeIn();
        }

    </script>	
</head>
<body  ontouchstart="">
       <!--header-->
	<div  id="header"> </div>

<div id="kaiqiDiv" class="kaiqiDiv pf w100 h100">
       <div class="of jz bcf br6">
           <div class="tittle tc">
               风险提示
           </div>
           <div class="content lh18 jz">
               <%=obj.vrrisk1%>
           </div>
           <div class="jz of clearfix" style="width: 90%">
               <input type="button" name="" value="放弃开启" id="giveUp" onclick="closekaiqi($('#kaiqiDiv'),$('.theme-popover-mask'));" class="kaiqiBtnRed cf tc db f18 br6 fl cursor"/>
               <input type="button" name="" value="我已了解，立即开启" id="okOpen" onclick="kaiqiSucess($('#kaiqiDiv'),$('#kaiqiSucess'));" class="kaiqiBtnGreen cf tc db f18 br6 fr cursor"/>
           </div>
       </div>
    </div><!--kaiqiDiv   -->

    <div id="kaiqiSucess" class="kaiqiDiv pf w100 h100">
        <div class="of jz bcf br6">
            <div class="tittle tc">
                开启成功
            </div>
            <div class="content lh18 jz">
                <%=obj.openuser%>
            </div>
            <div class="jz of clearfix" style="width: 90%">
                <input type="button" name="" value="我已了解" id="sure" onclick="sucessHref($('#kaiqiSucess'),$('.theme-popover-mask'));" class="kaiqiBtnGreen cf tc db f18 br6 jz cursor"/>
            </div>
        </div>
    </div><!--kaiqiSucess-->

    <div id="zijinIframeDiv" class="zijinIframeDiv of db pf w100 h100">
        <div class="zijinIframe jz">
            <iframe class="w100 h100 of db" src="pc/ziJinZhuanRu2.jsp" frameborder="0" scrolling="no"  vsspace="0" hspace="0" marginwidth="0" marginheight="0" >

            </iframe>
        </div>
    </div><!--zijinIframeDiv-->


    <div class="container jz" style="margin-top: 18px;">
        <div class="w100 of" style="background: #fafafa">
            
            <div class="jz" style="width: 1120px;margin-top: 30px;">
            <%if(CacheClass.getIntValue(user.isvruser)==0){%>
             <div  class="w100 db pr" onclick="kaiqi($('#kaiqiDiv'),$('.theme-popover-mask'));">
                    <img src="<%=(imgPath+obj.vradv0) %>" class="db" style="margin:10px auto;">
                    <div class="pa w100" style="bottom:24px;left: 0;z-index: 2">
                        <span class="whiteBtn db tc cf f24 fb jz" >立即开启</span>
                        
                    </div>
                    <script>
                        function kaiqi(kaiqiDiv,mask) {
                            var kaiqiDiv = kaiqiDiv;
                            var mask = mask;
                            mask.fadeIn();
                            kaiqiDiv.slideDown();
                        }
                        function kaiqiSucess(kaiqiDiv,sucesskaiqiDiv) {
                        
                            console.log("同意");
                        
                             $.ajax({
					            url: "PlugServlet",
					            data: JSON.stringify({m:241}),
					            type: 'post',
					            dataType: 'json',
					            contentType:"application/json;charset=utf-8",
					            success: function (data) {
					               if(data['state']==1)
					               {
					                    kaiqiDiv.slideUp();
                            			sucesskaiqiDiv.slideDown();
					               }
								  else
								  	layer.alert(data.info);
					            },
					            error: function (data) {
					                layer.alert(data.msg);
					                return false;
					            }
					        });
                        }
                        function closekaiqi(Div,mask) {
                            var Div = Div;
                            var mask = mask;
                            Div.slideUp();
                            mask.fadeOut();
                        }
                        function sucessHref(Div,mask) {
                            closekaiqi(Div,mask);
                            $("#zijinIframeDiv").slideDown();
                            mask.fadeIn();
                        }
                    </script>
                </div>
             <%}else{ %>
                 <a href="pc/QiZhiTouZiDetail.jsp" class="w100 db">  
               <!-- <a href="pc/QiZhiTouLogin.jsp" class="w100 db">-->
                    <img src="<%=(imgPath+obj.vradv1) %>" class="db" style="margin:5px auto;">
                   <span  class="whiteBtn db tc cf f24 fb jz">点击进入</span>
                </a>                
                
               <%} %>
                
                <div class="w100 clearfix of mgt20 ">
                    <a onclick="Sub2();"  class="fl db pr of">
                        <img src="<%=(imgPath+obj.vradv2) %>" class="db w100">
                        <div class="pa w100" style="bottom:103px;left: 0;z-index: 2"><span  class="whiteBtn db tc cf f24 fb jz">名额已满</span></div>
                    </a>
                    <a onclick="Sub2();"  class="fr db pr of">
                        <img src="<%=(imgPath+obj.vradv3) %>" class="db w100">
                        <div class="pa w100" style="bottom:103px;left: 0;z-index: 2"><span  class="whiteBtn db tc cf f24 fb jz">名额已满</span></div>
                    </a>
                </div>
                
                
                
            </div>

        </div>

	<div class="of jz lh15" style="width: 75%;margin-top: 35px;">
		<p class="f20 c6">风险提示：</p>
		<div class="c9 f15" style="margin-left: 9px;margin-top: 9px;">
			<%=obj.vrrisk%>
		</div>
	</div>

</div><!--container-->

    <div id="footer" class="footer w100 of">   </div><!--footer-->

<div id="loadingfDiv" class="loadingfDiv pf w100 h100 db">
    <div class="w100 h100">
        <img src="pc/images/loading.gif" class="db jz" style="margin-top: 40%;">
    </div>
</div><!--loadinfDiv-->
<script>

function Sub2() {
 	layer.alert("名额已满");
}
 

</script>
</body>
</html>